  //extract the cursor position.

procedure TForm1.Button1Click(Sender: TObject);
var
pt:tpoint;
begin
getcursorpos(pt);
showmessage('The cursor pos. is: x='+inttostr(pt.x)+' y='+inttostr(pt.y);
end;

//SET the cursor position.
// with this code you can move the windows mouse cursor with code to  x,y position.


procedure TForm1.Button1Click(Sender: TObject);
var
pt:tpoint;
begin
pt.x:=15;
pt.y:=98;
setcursorpos(pt.x,pt.y);
showmessage('The cursor pos. is: x='+inttostr(pt.x)+' y='+inttostr(pt.y);
end;
